package com.ayu.auth.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

/**
 * @Author: 徐林玉//作者及
 * @Date: 2021/9/26//完成日期
 * @Description: //
 * @Version: v0.0.1 // 版本信息
 * @Function List: // 主要函数及其功能
 * @Others: // 其它内容的说明
 * @History: // 历史修改记录
 **/
@Getter
@Setter
public class SysUser implements UserDetails
{


	private String id;

	private String username;

	private String password;

	private String status;

	private List<SysRole> roles;



	@JsonIgnore
	@Override
	public Collection<? extends GrantedAuthority> getAuthorities()
	{
		return roles;
	}


	@JsonIgnore
	@Override
	public String getPassword()
	{
		return password;
	}


	@JsonIgnore
	@Override
	public String getUsername()
	{
		return username;
	}


	@JsonIgnore
	@Override
	public boolean isAccountNonExpired()
	{
		return true;
	}


	@JsonIgnore
	@Override
	public boolean isAccountNonLocked()
	{
		return true;
	}



	@JsonIgnore
	@Override
	public boolean isCredentialsNonExpired()
	{
		return true;
	}


	@JsonIgnore
	@Override
	public boolean isEnabled()
	{
		return true;
	}
}
